<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../vue.js"></script>

<body>
  <div id="app1">
    app1:{{title}}
  </div>

  <div id="app2">
    app2:{{title}}
  </div>

  <script>
    var Vue2 = Vue.extend({
      // 在拓展构造器里面定义了数据，那么就是使用了这里的data，如果在继承的构造器里面也有定义data，那么会被覆盖
      data() {
        return {
          title: "hello"
        }
      }
    })

    var vm1 = new Vue({
      el: "#app1",
      data: {
        title: ""
      }
    })

    var vm2 = new Vue2({
      el: "#app2",
      data: {
        title: ""
      }
    })
  </script>
</body>

</html>